# Maintainer : Laurent Carlier <lordheavym@gmail.com>
# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>

pkgname=performous
pkgver=1.3.0
pkgrel=1
pkgdesc='A free game like "Singstar", "Rockband" or "Stepmania"'
arch=('loong64' 'x86_64')
url="https://performous.org/"
license=('GPL')
depends=(
  'aubio'
  'boost-libs'
  'cairo'
  'ffmpeg'
  'fontconfig'
  'gcc-libs'
  'glib2'
  'glibc'
  'glibmm'
  'icu'
  'fmt'
  'libepoxy'
  'libjpeg-turbo'
  'libpng'
  'librsvg'
  'libxml++2.6'
  'opencv'
  'pango'
  'portaudio'
  'portmidi'
  'sdl2'
)
makedepends=(
  'cmake'
  'boost'
  'git'  # TODO: this is used to clone sources during build time and should be devendored!!!
  'glm'
  'help2man'
  'nlohmann-json'
  'mesa'
)
optdepends=('performous-freesongs: free songs for performous')
options=('!lto')
source=($pkgname-$pkgver.tar.gz::https://github.com/performous/performous/archive/refs/tags/${pkgver}.tar.gz)
sha512sums=('d10e52e82034ae6ef5ae5efc9980d39f473c4f5be10082fd0ce6e776cb382e1cb2c546649c477c03684b207e06c051e1a9a488330f1421db38baf5c0e47de594')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CMAKE_BUILD_TYPE=None
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
